<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>案例操作</title>
</head>
<body>
    <script>
        const arr =[1,[2,[3,[4,5]]],6];
        const newarr=JSON.parse('['+JSON.stringify(arr).replace(/\[|\]/g,'')+']');//先把数组转成字符串在进行
        console.log(arr);
        console.log(newarr);
        const arr1=[1,2,3,4,5,6,1,2,3,4,5,61,2,3,4,5,6]
        const arr2=Array.from(new Set(arr1)); //Array.from(new Set()) 数组去重
        console.log(arr1);
        console.log(arr2);
    </script>
</body>
</html>